package com.yukh.framework.base.net.socket.demo4;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.SocketChannel;

class Send implements Operator {
	public static final Send operator = new Send();
	
	public int io(SocketChannel channel, ByteBuffer buffer) throws IOException {
		return channel.write(buffer);
	}

	public static final void operate(final SelectionKey key,
			final ByteBuffer buffer, final long endTime) throws IOException {
		Operation
				.operate(SelectionKey.OP_WRITE, key, buffer, endTime, operator);
	}
}
